<button class="layui-btn layui-btn-sm delall${object.code}" title="删除">
 	    <i class="layui-icon">&#xe640;</i> 
</button>
<script type="text/javascript">
$(function () {
//批量删除
$(".delall${object.code}").click(function(){
	var table = layui.table;
    
	 var checkStatus = table.checkStatus('${gridId!}Table')
     ,data = checkStatus.data;
     console.log(data);
    
    if(data.length > 0) {
        //for (var i in data) {
        //	ids.push(data[i].pk_val);
        //}
        layer.confirm('确定删除选中的${object.name}？', {icon: 3, title: '提示信息'}, function (index) {
        	
        	var json2 = JSON.stringify(data);
			$.syncPost('/grid/delete/${object.code}' , {
				rows : json2
			}, function(result, status) {
				if (result.success) {
					//$.slideMsg("删除成功！");
					//$.widgetReLoad($widget);
					
					layer.msg("删除成功。");
					table.reload('${gridId!}Table', null);
				} else {
					//$.alert($, result.msg);
					
					layer.msg("删除失败。");
				}
			});
        	
          
        })
    }else{
        layer.msg("请选择需要删除的${object.name}");
    }
});

});
</script>